package com.gj.tourismcommunity.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("user")
public class User {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField(value = "username")
    private String username;
    
    @TableField(value = "email")
    private String email;
    
    @TableField(value = "password")
    private String password;
    
    @TableField(value = "avatar")
    private String avatar;
    
    @TableField(value = "role")
    private String role;
    
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
    
    @TableField(value = "deleted")
    @TableLogic
    private Integer deleted;
    
    // 用户角色枚举
    public enum Role {
        USER, ADMIN
    }
}
